package com.xb.loan.cashier.biz.service;


import com.xb.loan.cashier.biz.dao.bean.CashierAccount;
import com.xb.loan.cashier.biz.dao.bean.CashierAccountDetail;

/**
 * 对账总表业务逻辑
 */
public interface CashierAccountService {

    /**无账期的值**/
    public static final String NOT_ACCOUNT_DAY = "19000101";
    
    void insertAccount(String accountId, int payChannelType, int orderType, String accountDay);
    
    void insertAccountDetail(CashierAccountDetail accountDetail);
    
    /**
     * 插入无账期的数据
     * 2015-9-15 by lottery
     */
    void insertAccountNon(int payChannelType, int orderType);

    CashierAccount selectAccountNon(int payChannelType, int code);
    
    String selectAccountId();

    int updateAccount(CashierAccount cashierAccount);

    /**
     * 将之前的对账数据迁移到历史表
     * 如果上次对账完成则移动到历史表，如果上一次对账未完成则直接删除对账结果 
     * @param payChannelType
     * @param orderType
     * @param day
     * 2015-9-15 by lottery
     */
    void dealHistoryAccountResult(int payChannelType, int orderType, String day);

    void deleteAccountDetail(String orderId);
    
    /**
     * 根据平台账期查询第三方是否已对完账
     * @param accountPeriod
     * @param orderType
     * @return
     * 2015-9-16 by zhaolijun
     */
    public int queryCountByAccountPeriod(String accountPeriod, int orderType);

}
